﻿<?xml version="1.0" encoding="utf-8" ?>
<CommandConfiguration xmlns="http://tempuri.org/HostCommandDefinitions.xsd">
  <CommandName>Generate a MAC on a message using a TAK or ZAK.</CommandName>
  <Request>M6</Request>
  <Response>M7</Response>

  <Field>
    <Name>Mode Flag</Name>
    <Length>1</Length>
    <Type>Numeric</Type>
    <ValidValue>0</ValidValue>
    <ValidValue>1</ValidValue>
    <ValidValue>2</ValidValue>
    <ValidValue>3</ValidValue>
    <RejectionCodeIfInvalid>02</RejectionCodeIfInvalid>
  </Field>
  
  <Field>
    <Name>Input Format Flag</Name>
    <Length>1</Length>
    <Type>Numeric</Type>
    <ValidValue>0</ValidValue>
    <ValidValue>1</ValidValue>
    <ValidValue>2</ValidValue>
    <RejectionCodeIfInvalid>03</RejectionCodeIfInvalid>
  </Field>

  <Field>
    <Name>MAC Algorithm</Name>
    <Length>2</Length>
    <Type>Numeric</Type>
    <ValidValue>01</ValidValue>
    <ValidValue>03</ValidValue>
    <RejectionCodeIfInvalid>04</RejectionCodeIfInvalid>
  </Field>

  <Field>
    <Name>Padding Method</Name>
    <Length>1</Length>
    <Type>Numeric</Type>
    <ValidValue>0</ValidValue>
    <ValidValue>1</ValidValue>
    <ValidValue>2</ValidValue>
    <RejectionCodeIfInvalid>09</RejectionCodeIfInvalid>
  </Field>

  <Field>
    <Name>Key Type</Name>
    <Length>3</Length>
    <Type>Hexadecimal</Type>
    <ValidValue>003</ValidValue>
    <ValidValue>008</ValidValue>
    <RejectionCodeIfInvalid>05</RejectionCodeIfInvalid>
  </Field>

  <Field>
    <Name>Key</Name>
    <IncludeFile>MultiFormatKey.xml</IncludeFile>
  </Field>

  <Field>
    <Name>IV</Name>
    <Length>16</Length>
    <Type>Hexadecimal</Type>
    <DependentField>Mode Flag</DependentField>
    <DependentValue>1,2</DependentValue>
    <ExclusiveDependency>false</ExclusiveDependency>
  </Field>

  <Field>
    <Name>Message Length</Name>
    <Length>4</Length>
    <Type>Hexadecimal</Type>
  </Field>

  <Field>
    <Name>Message</Name>
    <Length>1</Length>
    <DynamicFieldLength>Message Length</DynamicFieldLength>
    <Type>Character</Type>
  </Field>
  
</CommandConfiguration>
